Ext.define('planner.view.toolbars.MainToolBar', {
	extend: 'Ext.toolbar.Toolbar',
	alias : 'widget.MainToolBar',
	//renderTo: Ext.getBody(),
	vertical: true,
	width: 100,
	height: 100,
	initComponent: function(arguments) {
		this.callParent(arguments);
		var me = this;
		me.add(Ext.create('Ext.Button', {
			text: 'Create diagramm',
			menu: Ext.create('Ext.menu.Menu', {// <-- submenu by nested config object
				width: 150,
				height: 100,
				//plain: true,
				items: [
					{
						text: 'Common diagramm',
						handler: function() {
							console.log('MainToolBar: onCreateDiagramm');
							me.fireEvent('createDiagrammEvent', 'CommonDiagramm');
						}
					}, {
						text: 'Other diagramm',
					}
				]
			})		 	
		 }));
		me.add(Ext.create('Ext.Button', {
			text: 'Jobs',
			menu: Ext.create('Ext.menu.Menu', {// <-- submenu by nested config object
				width: 150,
				height: 100,
				//plain: true,
				items: [
					{
						text: 'Add job',
						handler: function() {
							console.log('MainToolBar: onAddJob');
							me.fireEvent('addJobEvent', 'job');
						}
					}, {
						text: 'Other diagramm',
					}
				]
			})		 	
		}));
		me.chooseCurrentDiagramm = Ext.create('Ext.Button', {
			text: 'Diagramm',
			menu: Ext.create('Ext.menu.Menu', {// <-- submenu by nested config object
				width: 150,
				height: 100,
				items: [
				]
			})		 	
		});
		me.add(me.chooseCurrentDiagramm);
		me.add(Ext.create('planner.view.toolbars.Trash'), {
		});

		var genericConfig = [{
            _name: 'Text Only'
        },{
            _name   : 'Disabled',
            disabled: true
        },{
            _name  : 'Icon Only',
            text   : null,
            iconCls: 'add'
        },{
            _name  : 'Icon and Text (left)',
            iconCls: 'add',
            iconAlign: 'left'
        },{
            _name  : 'Icon and Text (top)',
            iconCls: 'add',
            iconAlign: 'top'
        },{
            _name  : 'Icon and Text (right)',
            iconCls: 'add',
            iconAlign: 'right'
        },{
            _name  : 'Icon and Text (bottom)',
            iconCls: 'add',
            iconAlign: 'bottom'
        }],
        menu = {
            items: [{
                    text:'Menu Item 1'
                },{
                    text:'Menu Item 2'
                },{
                    text:'Menu Item 3'
            }]
        };
        var defaultConfig = {
	        cls: 'floater',
	        defaultType: 'splitbutton',
	        menu : menu,
	        arrowAlign: 'bottom'
	    };
		Ext.require('Ext.button.*');
		var v = Ext.createWidget(defaultConfig.defaultType || 'button', Ext.apply({
            text : 'Medium',
            scale: 'medium',
            color: 'blue'
        }, genericConfig, defaultConfig));
        me.add(v);




	},
	items: [
	]
});
 
